The present invention relates to a control method for a control software execution system, and more particularly to a control method for a control software execution system for an NC unit for efficiently executing software (a control program) for controlling a numerical control unit (described as NC unit hereinafter).
FIG. 73 is a block diagram showing general configuration of a control software execution system for a conventional type of NC unit, and in this figure the reference numeral 501 indicates an NC unit as a whole. Description is made hereinafter for general configuration of the conventional type of NC unit with reference to the hardware configuration in this NC unit 501.
In FIG. 73, designated at the reference numeral 1 is a main CPU for controlling operations of each section or executing computing required for numerical control, at 2 a system bus connecting section of the unit to each other, at 3 a ROM (non-volatile storage device) for storing control software or the like for realization of main functions of the NC unit 501, at 4 a RAM (volatile storage device) used for temporal data storage or as a work area.
Also in this figure, designated at the reference numeral 5 is a SIO interface section for transacting data with external devices by means of serial communications, at 6 a display unit for displaying a running state of the NC unit 501 or identifying an command given to the NC unit 501, at 7 a keyboard for giving commands to the NC unit 501 (input device), at 8 a servo control section for computing commands for controlling a servo motor. This servo control section 8 may comprise a dedicated CPU which is different from the main CPU 1.
Also in this figure, designated at the reference numeral 9 is a servo amplifier for electrically amplifying an command received from the servo control section 8 and driving a servo motor or a main shaft of machine tool (not shown), at 10 a servo motor for controlling a machining section of machine tool (not shown), at 11 a programmable control section (described as PC section hereinafter) for transacting data other than commands for servo control with the machine tool, at 12 a system clock (not shown) and an external interrupt signal inputted to the main CPU 1. The system clock is a clock signal for establishing synchronism for controlling the NC unit 501 as a whole. The external interrupt signal 12 is a signal for reporting an event (emergent state) such as power error or emergent stop to the main CPU 1.
Next, a description is made for operations. FIG. 74 is an explanatory view for explanation of a sequence for execution of analysis of a machining program for a control software execution system for the NC unit 501 shown in FIG. 73, and at first the main CPU 1 sequentially reads control software written in the ROM 3 via the system bus 2, and executes the contents.
In FIG. 74, in a machining program input processing 21, a machining program 20 is read via the SIO interface section 5 from the outside, and is stored in the RAM 4. Then, each block (a prespecified unit decided for each machining program to be inputted) is converted to internal data which can easily be processed internally.
Also in a correction computing processing 22, internal data for each block is processed and computed to obtain a travel. Also such parameters as a tool diameter or a tool length are corrected. Furthermore such operations as updation of internal coordinate values are executed. In a setting/display processing 23, various type of data for the NC unit 501 are displayed in the display unit 6. Also each of the various set-up data inputted by an operator using the keyboard 7 is stored in the RAM 4. In addition, in an interpolation processing 24, a travel for each shaft per minute time unit using a result of the correction computing processing 22.
In a servo processing 25, a result of the interpolation processing 24 is further converted to a travel for each shaft per minute time unit. Furthermore feedback control (not shown) is executed from a speed detector or a position detector (not shown herein) attached to the servo motor 10 or the machine tool (not shown) is executed. In a processing 26 by a programmable controller (described as PC hereinafter), control over peripheral devices around the machine tool such as input/output processing to and from the machine tool or the main shaft is executed.
As described above with reference to FIG. 73, the NC unit 501 can respond to an emergent state other than the normal processing flow such as emergency stop by receiving the external interrupt signal 12 and having interrupt processing executed. When the external interrupt signal 12 (Refer to FIG. 73) is inputted, the main CPU 1 executes a prespecified particular processing, and returns to the normal command after execution of the prespecified particular processing has been finished.
FIG. 75 is a concept view showing interrupt processing. In this figure, reference numerals 30 to 36 indicate a normal command, 37 to 40 indicate an interrupt command, and 41 indicates an command for return to normal command respectively. For instance, when an external interrupt signal 12 (Refer to FIG. 73) is inputted while the main CPU 1 executes a normal command 33, the main CPU 1 detects an interrupt after execution of the normal command 33, and starts execution of an interrupt command 37 specified previously. Then after execution of interrupt commands 37 to 40 is finished, the main CPU 1 executes the return command 41, returns to the normal command 34, and then executes normal commands 35, 36.
It should be noted that, if a time required for interrupt processing becomes longer, the possibility of multiple interrupt in which another interrupt is inputted during execution of interrupt processing becomes higher, and if any interrupt is inhibited during executing of interrupt processing, a quick response to an interrupt request becomes impossible, and for the reasons as described above it is desirable to make the time for interrupt processing as short as possible.
By the way, control software for the NC unit 501 has the features as described below.
At first, because of the variety of functions to be realized by the control software for the NC unit 501, a number of required software is very large, and many people are required to be involved in development of the software.
Secondly, a response time (turn around time, dead line) required for execution of each function of control software for the NC unit 501 is different. For instance, in the servo processing 25 (Refer to FIG. 74), if some delay occurs in computing a result of processing, cutting is stopped, a work becomes a defective product, so that real time processing is required. On the other hand, in such a processing as display on the display unit 6, even if some delay occurs, not trouble is generated, so that real time processing is not required.
Thirdly, a processing by control software for the NC unit 501 is not of a batch type, nor of a compiler type (in which an entire machining program is analyzed from its beginning to the end and then all the moving data for a servo is outputted at once), but of an interpreter type (in which a machining program is divided to several blocks, the blocks are analyzed one by one, and also the moving data for servo is outputted little by little).
Fourthly, there are many types of interrupt processing to be executed by the main CPU 1.
Because of these features, generally control software for the NC unit 501 is based on a real time operating system (described as RTOS hereinafter), and usually a task for each function to be executed under the control is regarded as an execution unit.
Next, a description is made for a method of controlling each task with the RTOS. To check dispatching priority of each task at a specified time interval or to delay execution of a task by a specified period of time, generally a timer interrupt (not shown) is loaded to the main CPU 1 (Refer to FIG. 73) at a certain cycle. This is called system clock.
Also the RTOS checks a state of each task each time system clock interrupt is generated, stops a task in execution, and has other task executed. This is called scheduling or dispatch.
Furthermore in the RTOS, dispatching priority (priority in execution) is assigned to each task. This dispatching priority means that, while a task having lower dispatching priority is being executed, if a task having higher dispatching priority is ready for execution, execution of the task having lower dispatching priority is interrupted and the task having higher dispatching priority is executed. This is called preempt of task.
FIG. 76 is a timing chart showing a relation in terms of time between operations in each task, and in this figure, a time required for processing largely varies in such a task as the correction computing task because of complicatedness of a task to be computed. Generally a system clock cycle is decided assuming a task requiring the longest processing time. As a result, when other task is executed, idle time when the main CPU 1 is not executing any effective processing, as T1 shown i FIG. 76, is generated. Also it should be noted that, in FIG. 76, when there is not any other processing to be executed, a processing is waited in a loop in the RTOS as described above.
Generally, the RTOS has a function to run a task at a specified cycle or a function to measure a running time of a task, but these time-related factors can only be controlled or measured with a time unit which is a multiple of an integral number of the system clock xcex94T.
Among the three tasks shown in FIG. 76, a processing time (computing time) for the servo processing task, display setting task is kept constant respectively. However, in the correction computing task, a processing time largely varies according to contents of a machining program. On the other hand, the servo processing task executes data communications or the like to the servo amplifier 9, so that the task is run once for one system clock cycle. Otherwise, data for running the servo motor 10 forward the amplifier unit can not be transmitted, and operation of the servo motor 10 is stopped.
For this reason, control is provided by, for instance, terminating execution of the correction computing task for each block of a machining program so that a time for running once will not become excessively long. On the contrary, however, even if a processing time for the correction computing task is short and a total of processing time for the three tasks is 1/N (N: an integral number) of the system clock, each task runs only once for each system clock cycle. Because of this restriction, there is an upper limit for cutting feed speed in an NC unit. For this reason, if each task can run twice for each system clock cycle, it is possible to double the cutting feed speed, and the machining time is reduced to approximately xc2xd of the original one as shown in FIG. 77.
The NC unit 501, which executes control software under control by the RTOS as described above, has various types of operating mode. The operating modes include, for instance, a state where a work is cut by means of automatic operation or in the manual mode, or a case where real machining is not executed and a graphic tool path is displayed for checking correctness of the machining program.
Also as a means for inputting a machining program, in addition to the EIA format which is a standard machining program for the NC unit 501, for instance, an automatic programming is available. This is for automatically controlling a speed or a position of tool, or an operation thereof such as in a case where, when data for a tool to be used, a form of a work, and a final machine form or other parameters are inputted and as a result, the final form is automatically provided as a result of machining as shown in FIG. 78A and FIG. 78B.
A task for analyzing the EIA format or a machining program such as an automatic programming as described above executes the processing as shown in FIG. 79. Namely, ZZZ1 is a processing for reading a machining program by 1 block and storing the block in a work area on a memory. ZZZ2 is a processing for analyzing the data read in ZZZ1 and preparing data to be delivered to the correction computing task.
ZZZ3 is a processing for issuing SVC to terminate a task. With this SVC, this task delivers the right for using the main CPU 1 to other task. Then the system enters the stand-by state until, for instance, the correction computing task demands the next data and the machining program starts the analysis task.
However, in the control software execution system for an NC unit having the configuration as described above, the problems as described below occur.
At first, an order for execution of tasks each realizing functions of an NC unit can be decided only according to the dispatching priority, and for this reason it is impossible to cyclically run all tasks, or to decide an execution time for each task.
Secondly, even in a case where task control is carried out according to timing, the time unit is limited to a time unit of the system clock (a multiple of an integral number of system clock).
Thirdly, it is extremely difficult to decide dispatching priority for each task, and in a case where three or more tasks are involved therein, so called the priority inversion (a phenomenon of inversion of dispatching order in which a task having lower dispatching priority stops execution of a task having higher dispatching order) may occur, so that there are several restriction for practical operations in the execution system based only on the dispatching order.
Fourthly, as dispatching priority between tasks is decided when a system is prepared, there exist tasks short in a processing time, or those having, on the contrary, excessive processing time.
Fifthly, as a processing requiring specification of a cycle is treated as an interrupt, the processing must be short, which is one of the restrictions over the system operations.
Sixthly, irrespective of the fact that a load to each task varies according to a running state or running mode of an NC unit, a running state of each task is decided when the system is generated, and the state can not be changed later.
Seventhly, there is no means for determining whether a task is in the normal state or not (a task has fallen in an abnormal state).
Eighthly, irrespective of size of one block in a machining program, a machining program analysis task ends each time analysis of one block is finished, so that a processing time may become short or excessive according to size of one block.
It is an object of the present invention to allocate an appropriate processing time to each task by realizing flexibility in a system for specifying an execution for each task and thereby obtain an effective control method for a control software execution system.
In the control method for a control software execution system according to the present invention, control of tasks each realizing a function of an NC unit respectively can be executed by a small time unit, furthermore a cycle for starting the task can easily be specified, so that waste of the time allocated to each task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control for tasks each realizing a function of an NC unit can be executed by the running time, waste of the time allocated to each task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, continuous running time can be insured for task each realizing functions of an NC unit respectively, so that waste of the time allocated to each task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control according to an accurate starting time and a running time can be executed for tasks each realizing a function of the NC unit respectively, so that waste of the time allocated to each task can be reduced, and furthermore a task can be controlled by the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control according to an accurate starting time and a continuous running time for tasks each realizing a function of the NC unit respectively can be executed, so that waste of the time allocated to each task can be reduced, and furthermore a task can be controlled within the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, an accurate executing time for tasks each realizing a function of the NC unit respectively can be acquired, so that allocation of a running time for each task can easily be executed, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, an accurate executing time for a task for realizing functions of an NC unit as well as for an interrupt processing can be acquired, so that allocation of a running time for each task can easily be executed, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, a running time for all tasks can be recorded, and furthermore a rate of a running time for all tasks can be specified, so that allocation of a running time for each task can be optimized. For this reason, an accurate executing time for interrupt processing can be acquired, and allocation of a running time for each task can easily be executed, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, allocation of a running time for each task can automatically be optimized according to operating conditions of the unit, so that wasting time in each task can be eliminated. Namely, a task can be run only for a period of time appropriate for the task in each mode by changing a running rate for a task according to an operating mode of the an NC unit, so that an executing speed of an NC unit can be improved.
In another control method for a control software execution system according to the present invention, a rate for running time allocated to each task can be changed while operating the NC unit, wasting time in each task can be eliminated, and a machining time in machining of repetition can be shortened by automatically setting allocation of a running time for each task realizing a function of an NC unit to be optimal.
In another control method for a control software execution system according to the present invention, a task in which an error has been generated can be defined by comparing the running time. Namely when an error has been generated in a task realizing a function of an NC unit, the fact can be detected, and for this reason determination can immediately be made that an error has been generated in the NC unit.
In another control method for a control software execution system according to the present invention, when it is determined that an error has occurred in automatic machining by the NC unit, automatic machining is executed again by changing a tool, so that the possibility that machining process stops due to occurrence of an error can be reduced, and continuous machining is automatically realized, and for this reason reliability for continuous running of an NC unit can be improved.
In another control method for a control software execution system according to the present invention, when it is determined that an error has occurred in automatic machining by the NC unit, automatic machining is executed again by changing a tool speed, so that the possibility that machining stops due to occurrence of an error can be reduced, and continuous machining can automatically be executed, and for this reason reliability for continuous running of an NC unit can be improved.
In another control method for a control software execution system according to the present invention, when it is determined that an error has occurred in automatic machining of the NC unit, automatic machining is executed again by other machining program, so that the possibility that machining stops due to occurrence of an error can be reduced, and for this reason continuous machining can automatically executed and reliability for continuous running of an NC unit can be improved.
In another control method for a control software execution system according to the present invention, a running time for tasks each realizing a function of an NC unit respectively is limited, so that each task will not run for a period of time exceeding an allocated period of time for the task, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control for tasks each realizing a function of an NC unit respectively can more precisely be executed, and a processing time for each task can be optimized, so that waste of the time can be reduced and a total processing time can be shortened. In addition, the system itself can determine abnormal conditions in the control software execution system for the NC unit, so that a processing for avoidance from occurrence of abnormal conditions therein can easily be executed.
In another control method for a control software execution system according to the present invention, control according to a period of time for tasks each realizing functions of an NC unit can be executed with a small time unit, furthermore a cycle for starting a task can easily be specified so that waste of the time allocated for each task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control according to a rate for a running time for tasks each realizing a function of an NC unit respectively can be executed, so that waste of the time allocated for each task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, a continuous running time for tasks each realizing a function of an NC unit respectively can be insured, so that waste of the time allocated for a task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control according to an accurate starting time and a running time for tasks each realizing a function of an NC unit respectively can be executed, so that waste of the time allocated for each task can be reduced, and furthermore a task can be controlled according to the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control according to an accurate starting time and a continuous running time for tasks each realizing a function of an NC unit respectively can be executed, so that waste of the time allocated for each task can be reduced, and furthermore a task can be controlled within the running time, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, an accurate executing time for tasks each realizing a function of an NC unit respectively can be acquired, so that allocation of a running time for each task can easily be executed, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, an accurate executing time for task each realizing a function of an NC unit respectively and an interrupt time can be acquired, so that allocation of a running time for each task can easily be executed, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, a running time for all tasks can be recorded, and furthermore a rate of the running time for a task can be specified, so that allocation of a running time for each task can be optimized. In addition, an accurate executing time for an interrupt can be acquired, and allocation of the running time for each task can easily be executed, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, allocation of a running time for each task can automatically be optimized according to operating conditions of the unit, waste of the time can be eliminated in each task. Namely, a task can be run only for a period of time appropriate to the task in each mode by changing a running rate for a task according to an operating mode of the NC unit, and an executing speed of an NC unit can be improved.
In another control method for a control software execution system according to the present invention, a rate of running time allocated for each task can be changed while running the NC unit, so that waste of the time thereof can be eliminated in each task, and by automatically optimizing a rate of the running time for tasks each realizing a function, the machining time in machining of repetition can be shortened.
In another control method for a control software execution system according to the present invention, a task in which an error has been generated can be defined by comparing the running time. Namely when an error has been generated in the task realizing a function of the NC unit, the fact can be detected, so that determination can immediately be made that an error has been generated in the NC unit.
In another control method for a control software execution system according to the present invention, restriction according to a running time for tasks each realizing a function of an NC unit can be executed, so that a task will not run exceeding an allocated period of time for each task, and because of this feature system construction becomes easier.
In another control method for a control software execution system according to the present invention, control for tasks each realizing a function of an NC unit respectively can more precisely be executed, so that a processing time for each task can be optimized, and for this reason waste of the time thereof can be reduced, and a total processing time can be shortened. In addition, the system itself can determine abnormal conditions of the control software execution system for an NC unit, so that a processing for avoidance from occurrence of abnormal conditions therein can easily be executed.
Other objects and features of this invention will become understood from the following description with reference to the accompanying drawings.